import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

const store = new Vuex.Store({
    state: {
        currentSong: {},
        songsList: [],
        currentSongIndex: -1,
    },
    mutations: {
        setCurrentSong(state, data) {
            state.currentSong = data;
        },
        setSongsList(state, list) {
            state.songsList = list;
        },
        setCurrentSongIndex(state, index) {
            state.currentSongIndex = index;
        },
    },
});

export default store;